import urllib.request
import json

if __name__ == '__main__':
    url = "http://127.0.0.1:8892/syn-service/dev-api/api/language/toSimplified"
    headers = {
        "Content-Type": "application/json"
    }

    # 构建请求数据
    data = {
        "words": "我是简体"
    }
    data = json.dumps(data).encode('utf-8')

    # 发起请求
    req = urllib.request.Request(url, data=data, headers=headers)
    response = urllib.request.urlopen(req)

    # 处理响应
    result = response.read().decode('utf-8')
    print(result)